public void downLoad() throws Exception {

        String imageUrl = "https://upload-images.jianshu.io/upload_images/5809200-736bc3917fe92142.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240\n";
        String destinationPath = "/Users/chipingyung/IdeaProjects/xz/eoms-ocscomplaint/src/newdoc/test.jpg"; // 替换为你想要保存的文件名

        try (InputStream is = new URL(imageUrl).openStream();
             FileOutputStream fos = new FileOutputStream(destinationPath)) {

            byte[] buffer = new byte[4096]; // 增加缓冲区大小以提高性能
            int length;
            while ((length = is.read(buffer)) != -1) {
                fos.write(buffer, 0, length);
            }

            System.out.println("图片下载完成！");
        } catch (Exception e) {
            System.err.println("图片下载失败: " + e.getMessage());
            e.printStackTrace();
        }
    }